package com.share.shareplatform.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Reward {

    public static final int MAX_DISTANCE=100000;

    private Long id;
    private Long userId;

    @NotBlank(message = "需求不能为空")
    @Length(max = 100,message = "需求内容过长")
    private String need;

    @DecimalMax(value = "180",message = "经度有误")
    @DecimalMin(value = "-180",message = "经度有误")
    private Double longitude;//经度

    @DecimalMax(value = "90",message = "纬度有误")
    @DecimalMin(value = "-90",message = "纬度有误")
    private Double latitude;//纬度
    private String address;//经纬度地址
    @Length(max = 100,message = "联系方式过长")
    private String contact;//联系方式

    private List<Provide> provideList;

    private Integer distance;

}
